<?php
class Filter_Creator
{
	private static $_instance;
	
	private $_storage = array();
	
	protected function __construct()
	{}
	
	protected function __clonew()
	{}
	
    static public function getInstance()
    {
        if (self::$_instance == null)
        {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    
	public function getFilter($filterName)
	{
		if ($filterName)
		{
			if (!isset($this->_storage[$filterName])) 
			{
				require_once dirname(__FILE__).'/'.$filterName.'.php';
				$className = 'Filter_'.$filterName;
				$filter = new $className;
				$this->_storage[$filterName] = $filter;
			}
			return $this->_storage[$filterName];
			
		} else return false;	
	}
}
?>